# Contributor: Grigory Kirillov <txgk@bk.ru>
# Maintainer:
pkgname=cddlib
pkgver=0.94m
pkgrel=2
pkgdesc="Library implementing Double Description Method for convex polyhedra"
url="https://people.inf.ethz.ch/fukudak/cdd_home"
arch="all"
license="GPL-2.0-or-later"
makedepends="gmp-dev"
source="https://github.com/cddlib/cddlib/releases/download/$pkgver/cddlib-$pkgver.tar.gz"
subpackages="
	$pkgname-static
	$pkgname-dev
	$pkgname-tools:_tools
	$pkgname-doc
	"

build() {
	export CFLAGS="${CFLAGS/-Os/-O3}" # gotta go fast

	./configure \
		--target="$CTARGET" \
		--build="$CBUILD" \
		--host="$CHOST" \
		--prefix=/usr
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

_tools() {
	pkgdesc="$pkgdesc (utilities)"
	amove usr/bin
}

sha512sums="
50997bda38c36990456345881dc1eac65b1880aa510ea3812ae46a122ba7696bf3577f2b6976ff16811ee00f0a920c8ed6f1e7de0a4060bfaa96def11bab816e  cddlib-0.94m.tar.gz
"
